package com.wzqj.agent.web.demo.controller;

import com.wzqj.agent.web.demo.domain.UserInfo;
import com.wzqj.agent.web.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 创建时间：2015-7-27 下午1:17:27
 * @author wh
 * @version 2.2
 */
@Controller("demoWebController")
@RequestMapping("/userDemo")
public class UserWebController {

	@Autowired
	private UserService userService;
	
	@RequestMapping("/showInfo/{userId}")
	public String showUserInfo(ModelMap modelMap, @PathVariable int userId){
		UserInfo userInfo = userService.getUserById(userId);
		modelMap.addAttribute("userInfo", userInfo);
		return "/user/showInfo";
	}
}
